<?php
namespace app\decorate\controller;
use app\AdminRest;
use think\App;
use think\Request;
use app\decorate\model\AdminAppointment as app_model;

class AdminAppointment extends AdminRest{
    protected $model;
    public function __construct(App $app) {
        parent::__construct($app);
        $this->model = new app_model();
    }
    /**
     * User: chenniang
     * Date: 2019-10-09 15:58
     * @return \think\Response
     * descption:预约列表
     */

    public function appList(){
        $input = $this->_param;
        $dis[] = ['a.uniacid','=',$this->_uniacid];
        $dis[] = ['a.status','>',-1];
        if(!empty($input['staff_id'])){
            $dis[] = ['a.staff_id','=',$input['staff_id']];
        }
        $where = [];
        if(!empty($input['name'])){
            $where[] = ['a.name','like',"%\\".$input['name']."%"];
            $where[] = ['a.mobile','like',"%\\".$input['name']."%"];
            $where[] = ['b.nickName','like',"%\\".$input['name']."%"];
        }
        $data  = $this->model->appList($dis,$input['limit'],$where);
        return $this->success($data);
    }









}
